package com.dly.blog.exception;

import com.dly.blog.content.ExceptionContent;
import lombok.Getter;

@Getter
public enum CommonExceptionEnum {

    USER_EXCEPTION(new CommonException(ExceptionContent.CommonException + 1, "用户信息异常")),

    WX_SEND_ERROR(new CommonException(ExceptionContent.CommonException + 2, "调用微信异常")),

    WX_OPENID_NULL(new CommonException(ExceptionContent.CommonException + 3, "微信openId获取为空")),

    JSON_LOAD_TO_STRING(new CommonException(ExceptionContent.CommonException + 4, "JSON转化失败"))

    ;
    
    CommonExceptionEnum(CommonException commonException){
        this.commonException = commonException;
    }

    private final  CommonException commonException;


    public static class CommonException extends GlobalException{

        private static final String MODULE = "Common";
        public CommonException(int code, String message) {
            super(code, message, MODULE);
        }
    }
}